package edu.zut.cs.javaee.manager.department.service;


import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import edu.zut.cs.javaee.manager.base.service.GenericGenerator;
import edu.zut.cs.javaee.manager.department.domain.Department;


public class DepartmentEntityGenerator extends GenericGenerator{

	
	DepartmentManager departmentManager;
	
	@Autowired
	public void setDepartmentManager(DepartmentManager departmentManager) {
		this.departmentManager = departmentManager;
		
	}
	String Department[]= {"软件工程","计科","信息","网络"};
	@Test 
	public void gen_depart() {
		for(int i=1;i<=4;i++) {
			Department department=new Department();
			department.setSname("department_"+i+"_"+Department[i-1]);
			this.departmentManager.save(department);			
		}
	}

}
